<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<jsp:useBean id="member" class="oneroom.admin.member.MemberDao" scope="page"/>
<jsp:useBean id="code" class="oneroom.admin.code.codeDao" scope="page"/>
<%@ page import="oneroom.admin.member.MemberModel" %>
<%@ page import="oneroom.admin.code.codeModel" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.List" %>
<%
	String name = request.getParameter("name") == null ? "": request.getParameter("name");
	String m_jumin1 = request.getParameter("m_jumin1") == null ? "": request.getParameter("m_jumin1");
	String m_jumin2 = request.getParameter("m_jumin2") == null ? "": request.getParameter("m_jumin2");
	HashMap	paramMap = new HashMap();
	boolean checkOk = false;	
	paramMap.put("jumin",m_jumin1+m_jumin2);
	checkOk	=  member.getJuminCheck(paramMap);
	MemberModel model	= new MemberModel();
	List list1 = code.getDtlList("100");
	List list2 = code.getDtlList("101");

	String mode = request.getParameter("mode") == null ? "I" : request.getParameter("mode");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>원룸몬스터</title>

<link href="/room/css/all.css" rel="stylesheet" type="text/css" />
<script src="/room/script/swfobject_modified.js" type="text/javascript"></script>
<script src="/room/script/common.js" type="text/javascript"></script>
<script src="/room/script/default.js" type="text/javascript" ></script>
<script src="/room/script/jquery-1.3.2.min.js" type="text/javascript" ></script>
<script type="text/javascript">
<%
if(checkOk == false){
%>
	alert("이미 가입하셨습니다.");
	location.href="/room/member/regi_agr.jsp";
<%	
}
%>
<!--
var id = "";
$(document).ready(function(){
	
	$('#email3').hide();
  
	$('#email2').change(function(){
	var val = $('#email2 > option:selected').val();
		if(val == ''){
	      $('#email3').show();
		}else{
		  $('#email3').hide();
		}    
	});  

	$('#idBtn').click(function() {
		window.open("id_check.jsp","idcheck","Width=320,Height=185");
	});
	
});
	function chkPassword(){
		  var obj = document.getElementById("pwd");
		  if(obj.value.search(/[^a-zA-Z0-9-_]/g) != -1){
		    alert('영문이나 숫자만 입력하실 수 있습니다');
		    obj.value = '';
		    return false;
		  }  
		  return true;
	}
		
	function chechk(){
		if($("#id").val() == "" ){
			alert("ID을 입력하세요.");
			return false;
		}else if($("#name").val() == ""){
			alert("이름을 입력하세요.");
			return false;
		}else if($("#pwd").val() == "" ){
			alert("비밀번호을 입력하세요.");
			return false;
		}else if($("#repwd").val() == ""){
			alert("비밀번호확인을 하세요.");
			return false;
		}else if($("#pwd").val() != $("#repwd").val()){
			alert("비밀번호확인을 하세요.");
			return false;
		}else if($("#tel1").val() == "" && $("#tel2").val() == "" && $("#tel3").val() == "" ){
			alert("전화번호를 입력하세요.");
			return false;
		}else if($("#hp1").val() == "" && $("#hp2").val() == "" && $("#hp3").val() == "" ){
			alert("전화번호를 입력하세요.");
			return false;
		}else if($("#email1").val() == "" && ($("#email2").val() == "" || $("#email3").val() == "") ){
			alert("E-mail를 입력하세요.");
			return false;
		}else if($("#email2").val() == "" ){
			alert("E-mail를 입력하세요.");
			return false;
		}else if(!isEng($("#email1").val())){
			alert("영문숫자만 가능합니다.");
			return false;
		}else if(!isEng($("#pwd").val())){
			alert("영문숫자만 가능합니다.");
			return false;
		}else{
			return true;
		}
	}
	
//-->
</script>
</head>

<body>
<div align="center"> 

 <div id="content">

<!----------------왼쪽---------------->  
<%@ include file="/room/common/left.jsp" %>
<!----------------왼쪽끝---------------->  


<!----------------가운데 시작----------------> 
<form name="frm" id="frm" action="dbx.jsp" method="post" onsubmit="return chechk();" >
<input type="hidden" name="mode" value="I" />
<input type="hidden" name="hiddenid" value="" />
<input type="hidden" name="grade" value="5" />
<input type="hidden" name="name" value="<%=request.getParameter("name")%>">
<input type="hidden" name="jumin1" value="<%=request.getParameter("m_jumin1") %>">
<input type="hidden" name="jumin2" value="<%=request.getParameter("m_jumin2") %>">
 <div id="rgt">
  <div id="con01">
   <div class="top bb1"><img src="/room/img/txt_top.gif" /></div> 
   <div>
    <div class="list h550">
      <div class="pb20"><span style="font-size:11px;">Home >회원> <span style="color:#000;">회원가입</span></span></div>
      <div>
       <div class="pb10"><img src="/room/img/line_blue.gif" width="32" height="2" /></div>
       <div class="tit">회원가입 </div>
     </div>
     <div><span style="font-size:11px;">홈페이지에 오신 여러분 환영합니다.</span></div>
     
     <div class="pt25 pb10"><span style="font-size:11px;"><strong>*항목은 필수 입력항목입니다.</strong></span></div>
    <table width="595" border="0" cellspacing="0" cellpadding="0">
	<col width="135px" />
	<col width="90px" />
	<col width="90px" />
	<col width="80px" />
	<col width="205px" />
  <tr>
    <td class="ac fw bt2 bb1 h30 bg_g">*이름</td>
    <!-- <td colspan="4" class="bt2 bb1 h30 pl10 "><input name="name" id="name" value="<%//=request.getParameter("name") %>" title="이름" type="text" maxlength="10" readonly="readonly" /></td> -->
    <td colspan="4" class="bt2 bb1 h30 pl10 "><%=request.getParameter("name") %></td>
    </tr>
  <tr>
    <td class="ac fw bb1 h30 bg_g">* 주민번호</td>
    <td colspan="4" class=" bb1 h30 pl10"><%=request.getParameter("m_jumin1") %> - *******</td>
     </tr>
  <tr>
    <td class="ac fw bb1 h30 bg_g">* ID</td>
    <td  colspan="4" class=" bb1 h30 pl10"><input name="id" id="id" value="<%=model.getId() %>" title="아이디" type="text" disabled="disabled" /><a href="#"><img  style="vertical-align:middle" src="/room/img/btn_id.gif" width="79" height="22" hspace="10" id="idBtn"/></a></td>
    </tr>
  <tr>
    <td class="ac fw bb1 h30 bg_g">* 비밀번호</td>
    <td colspan="4" class=" bb1 h30 pl10"><input name="pwd" id="pwd" value="<%=model.getPwd() %>" title="비밀번호" type="password" /><span style="font-size:11px;"> &nbsp;&nbsp;6~12자 이내, 영문, 숫자, 특수문자 조합</span> </td>
    </tr>
  <tr>
    <td class="ac fw bb1 h30 bg_g">* 비밀번호 확인</td>
    <td colspan="4" class=" bb1 h30 pl10"> <input name="repwd" id="repwd" value="" title="비밀번호확인" type="password" /> <span style="font-size:11px;">&nbsp;&nbsp;비밀번호를 한번 더 적어 주세요.</span></td>
  </tr>
  <tr>
    <td class="ac fw bb1 h30 bg_g">* 전화</td>
    <td class=" bb1 h30 pl10">
    <select style="width:70px;" name="tel1" id="tel1">
	    <option value="02">02</option>
	    <option value="031">031</option>
	    <option value="032">032</option>
	    <option value="033">033</option>
	    <option value="041">041</option>
	    <option value="042">042</option>
	    <option value="043">043</option>
	    <option value="051">051</option>
	    <option value="052">052</option>
	    <option value="053">053</option>
	    <option value="054">054</option>
	    <option value="055">055</option>
	    <option value="061">061</option>
	    <option value="062">062</option>
	    <option value="063">063</option>
	    <option value="064">064</option>
    </select> - 
    </td>
    <td class="ac bb1 h30"><input style="width:70px;" name="tel2" id="tel2" value="" title="전화번호"  maxlength="4" type="text" /> -</td>
    <td class="ac bb1 h30"><input style="width:70px;" name="tel3" id="tel3" value="" title="전화번호"  maxlength="4" type="text" /></td>
    <td class="ac bb1 h30">&nbsp;</td>
  </tr>
  <tr>
    <td class="ac fw bb1 h30 bg_g">* 휴대전화</td>
    <td class=" bb1 h30 pl10">
    <select style="width:70px;" id="hp1" name="hp1">
		<option value="010">010</option>
		<option value="011">011</option>
		<option value="016">016</option>
		<option value="017">017</option>
		<option value="018">018</option>
		<option value="019">019</option>
    </select> - 
    </td>
    <td class="ac bb1 h30"><input style="width:70px;" name="hp2" id="hp2" value="" title="핸드폰" maxlength="4" type="text" /> -</td>
    <td class="ac bb1 h30"><input style="width:70px;" name="hp3" id="hp3" value="" title="핸드폰" maxlength="4" type="text" /> </td>
    <td class="ac bb1 h30">&nbsp;</td>
  </tr>
  <tr>
    <td class="ac fw bb1 h30 bg_g">* 사용자 구분</td>
    <td class=" bb1 h30 pl10" colspan="3">
    <select id="authorize" style="width:120px;" name="authorize">
	<%
	//for(int i = 0; i<list1.size(); i++){
	//	codeModel codemodel = (codeModel)list1.get(i);
	//	
	%>
	      <!-- <option value="<%//=codemodel.getCode() %>"><%//=codemodel.getCodename()%></option> -->
	<%
	//} 
	%> 	
	      <option value="2">일반사용자</option>
	</select>
    </td>
  </tr> 
  <!-- 주석처리 기본 하위등급 tr>
    <td class="ac fw bb1 h30 bg_g">* 사용자등급</td>
    <td colspan="3">
    <select id="grade" style="width:70px;" name="grade">
	<%
	//for(int i = 0; i<list2.size(); i++){
	//	codeModel codemodel = (codeModel)list2.get(i);
	//	
	%>
	      <option value="<%//=codemodel.getCode() %>"><%//=codemodel.getCodename()%></option>
	<%
	//} 
	%> 
	</select>
    </td>
  </tr>-->     
  <tr>
    <td class="ac fw bb1 h30 bg_g">* 이메일</td>
    <td colspan="4" class=" bb1 h30 pl10">
	    <input type="text" id="email1" name="email1" value="" /> @ 
	    <input type="text" id="email3" name="email3" value="" style="ime-mode:inactive;"/>&nbsp;&nbsp;
	    <select style="width:100px;" id="email2" name="email2">
	        <option value="">선택하세요.</option>
	        <option value="">직접입력</option>
	        <option value="hanmail.net">hanmail.net</option>
			<option value="naver.com">naver.com</option>
			<option value="yahoo.com">yahoo.com</option>
			<option value="hotmail.com">hotmail.com</option>
			<option value="nate.com">nate.com</option>
			<option value="paran.com">paran.com</option>
			<option value="dreamwiz.com">dreamwiz.com</option>
			<option value="empal.com">empal.com</option>
	    </select>
    </td>
  </tr>
</table>
  <div class="pt10"><span style="font-size:11px;">*입력 하신 소중한 정보는 서비스 향상과 고객지원을 위해 사용됩니다.</span></div>
<div class="pt25 " align="center"><input type="image" src="/room/img/btn_ok.gif" width="47" height="26" /><a href="/room/main.jsp"><img src="/room/img/btn_cancle.gif" width="47" height="26" hspace="5" /></a></div>
    
    </div>
   </div>
</div>  
</form>
<!----------------가운데 끝---------------->


<!----------------오른쪽 시작---------------->  
<%@ include file="/room/common/right.jsp" %>  
<!----------------오른쪽 끝---------------->
</div>


<!-------------푸터영역----------> 
<%@ include file="/room/common/footer.jsp" %> 
<!-------------푸터영역----------> 
<script type="text/javascript">
swfobject.registerObject("FlashID");
</script>
</body>
</html>
